package com.company.cloud.crm.modules.data.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.company.cloud.common.constant.BaseConstant;
import com.company.cloud.crm.modules.base.entity.CustomerInfo;
import com.company.cloud.crm.modules.base.service.CustomerInfoService;
import com.company.cloud.crm.modules.data.service.CustomerDataStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerDataStatisticsServiceImpl implements CustomerDataStatisticsService {

    @Autowired
    private CustomerInfoService customerInfoService;

    @Override
    public Integer customerNumStatistics(Integer userId) {
        int num= customerInfoService.count(new QueryWrapper<CustomerInfo>()
                .eq("sale_user_id",userId)
                .eq("rows_state", BaseConstant.EnabledEnum.ENABLED.getCode())
        );
        return num;
    }
}

